﻿@model IEnumerable<WebCarts.Models.Cart>

@{
    ViewData["Title"] = "Index";
}

<h1>Index</h1>
<form asp-controller="Carts" asp-action="Index" method="get">
    <p>
        商品名称: <input type="text" name="searchstring"><input type="submit" value="查询" />
        售价区间：<input type="text" name="low" style="width:60px;">-<input type="text" name="high" style="width:60px;"><input type="submit" value="查询" />
    </p>
</form>
<p>
    <a asp-action="Create">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.ProductId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ProductNum)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.ProductPrice)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.UserId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreateTime)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.ProductId)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ProductNum)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ProductPrice)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UserId)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreateTime)
            </td>
            <td>
                <a asp-action="Edit" asp-route-id="@item.CartId">Edit</a> |
                <a asp-action="Details" asp-route-id="@item.CartId">Details</a> |
                <a asp-action="Delete" asp-route-id="@item.CartId">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>
